</div><?php#end container ?>

<?php
//输出脚本
global $ver;
echo ismobile()? "\n<script src=\"".TPDIR."/res/js/mobile.js\"></script>\n": "\n<script src=\"".TPDIR."/res/js/initial.js?ver=$ver\"></script>\n";
if( isIE8() ) echo "<!--[if lte IE 7]><script src=\"".TPDIR."/res/js/noie.js\"></script><![endif]-->\n";

if( is_singular() && !get('ini_mark') ){
	$fbox = 0;
	$pret = 0;
	if( !ismobile() || ismobile() && get('ini_mfbox') ) $fbox = 1;
	if( !ismobile() || ismobile() && get('ini_mpret') ) $pret = 1;
	if( get('ini_fancybox') && $fbox==1 ) echo "<script src=\"".TPDIR."/res/js/fancy.js\"></script>\n";
	if( get('ini_prettify') && $pret==1 ) echo "<script src=\"".TPDIR."/res/js/pretty.js\"></script>\n";
	$bg = 0;
	if( get('ini_media_bg') ){
		$custom_fields = get_post_custom_keys($post_id);
		if( in_array('music', $custom_fields ) || in_array( 'video', $custom_fields) ){
			$bg = 1;
		}
	}
	if( !ismobile() && $bg==1 && !get('ini_no_thumb') ) echo "<script src=\"".TPDIR."/res/js/StackBlur.js\"></script>\n";
}
?>

<center><footer id="footer"<?php if(get('ini_foot_c')) echo ' style=background:'.get('ini_foot_c').';border-color:'.get('ini_foot_c')?>>
	<div class="footer-ms immax">
<?php
echo '<div class="footer-widget">';dynamic_sidebar('sidebar-4'); echo "<div class=\"clear\"></div></div>\n";
if( !ismobile() && $obj_key==$ini_key || get('ini_mfoot') ) echo get('ini_footer');
if( !ismobile() && !get('ini_mark') || get('ini_mlink') ){
	$bookmarks = get_bookmarks('orderby=id&title_li=&categorize=');
	if( !empty($bookmarks) && get('ini_flink')=="显示" ){
		echo '<p>友情链接';
		foreach ($bookmarks as $bookmark) {
			$output .= '&nbsp;- <a href="'.$bookmark->link_url.'" rel="external">'.$bookmark->link_name.'</a>';
		}
		echo $output;
		echo "</p>";
	}
}
?>
	</div>
	<div class="footer-cr" style="<?php if(get('ini_foob_c') && !get('ini_mark')) echo 'background:'.get('ini_foob_c')?>">
	    <div class="immax">
		<?php
ini_copyright();
if ( get('ini_beian')!="" ) echo get('ini_beian').'.&nbsp;';
if( get('ini_fauthor')=="显示" ) echo "Theme By &nbsp;<a href='http://www.dujin.org' rel='external'>Initial (缙哥哥的博客)</a>.&nbsp;";
if( get('ini_fwp')=="显示" ) echo "Powered By &nbsp;<a rel='external nofollow' href='http://www.wordpress.org/'>WordPress</a>.";
?> CC共享协议4.0：署名-非商业性使用-相同共享方式 创作(BY-NC-SA)
		</div>
	</div></center>
</footer>

<div id="login-form" class="hide clear">
	<form action="<?php echo $url?>/wp-login.php" method="post">
		<p><input type="text" name="log" class="text" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" placeholder="用户名或邮箱"><i class="icon-user icon"></i></p>
		<p><input type="password" name="pwd" class="text" placeholder="密码"><i class="icon-lock icon"></i></p>
		<label><input name="rememberme" type="checkbox" class="checkbox" checked="checked" value="forever"> 记住我的登录信息</label>
		<br>
		<input type="submit" name="submit" class="button" value="确认登录">
		<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']?>">
	</form>
	<div class="action">
		<span><i class="icon-key"></i><a href="<?php echo $url?>/wp-login.php?action=register">注册帐号</a></span>&nbsp;&nbsp;|&nbsp;
		<span><i class="icon-question"></i><a href="<?php echo $url?>/wp-login.php?action=lostpassword">忘记密码</a></span>
	</div>
</div>
<div id="login-overlay"></div>

<?php if( !ismobile() ) :
	echo '<aside id="side-nav" class="slow">';
	echo '<button id="gotop"><i class="icon-arrow-up"></i></button>';
	if( is_singular() ) :
		global $post;
		if( 'open'== $post->comment_status && !is_page_template('tem/tougao.php') && !is_page_template('tem/archives.php') ) echo '<button id="cmt"><i class="icon-comments"></i></button>';
		if( !ismedia() && !is_page_template() ) echo '<button id="share"><i class="icon-share"></i></button>';
		if( is_page_template('tem/archives.php') ) echo '<button id="car-toggle">折叠</button>';
	endif;
	echo '</aside>';
endif
?>

<script>
<?php if( is_singular() && !get('ini_mark') && $obj_key==$ini_key ){
if( get('ini_media') && !ismobile() ) echo '$.support.leadingWhitespace&&$(function(){$("audio").audioPlayer();});';
if($bg==1) echo 'document.getElementById("gbk")&&$.support.leadingWhitespace&&setTimeout(function(){stackBlurImage( "gbk", "gb", 30 )},50);';
// 文章页添加百度分享
	if( get('ini_bdshare') ){
		// 为百度分享添加图片
		if( get('ini_bds_thumb') ){
			preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
			if ( has_post_thumbnail( $post->ID) ){
				$img = get_the_post_thumbnail( $post->ID, 'full' );
			}
			else
			if ( !empty( $matches[1][0]) ){ // 判断文章是否有图片
				$img = '<img src="'.$matches[1][0].'" class=""/>';
			}
			$img_src = preg_replace(array('/^.+(src=)(\"|\')/i', '/(\"|\')\sclass=(\"|\').+$/i'), array('', ''), $img );
		}
// 百度分享代码
?>
function bdText(){var content=$(".excerpt").html();return '【'+$(".entry-title").html()+'】'+content+'<?php echo get('ini_uid')? get('ini_uid'): '来自→'.get_bloginfo('name')?>';};window._bd_share_config={<?php if(get('ini_bds_img')&&!ismobile()&&is_single()){?>"image":{"viewList":["tsina","qzone","weixin","douban","twi","fbook"],"viewText":" ","viewSize":"24"},<?php } if(get('ini_bds_btn')){?>"common":{"bdSnsKey":{"tsina":"<?php echo get('ini_snkey')?>","tqq":"<?php echo get('ini_tckey')?>","t163":"<?php echo get('ini_wykey')?>","tsohu":"<?php echo get('ini_sokey')?>"},"bdText":bdText(),"bdMini":"2",<?php if(!ismobile()) echo '"bdMiniList":["mshare","mail","renren","tqq","t163","tsohu","ty","tieba","qq","bdysc","print","copy"],'?>"bdPic":"<?php echo $img_src?>","bdStyle":"1","bdSize":"32"},<?php } if(get('ini_bds_sel')&&!ismobile()&&is_single()){?>"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["tsina","qzone","weixin","douban","twi","fbook"],"bdContainerClass":"context","bdSize":"24"},<?php }?>"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
<?php
// 文章归档按钮
 if( !ismobile() && is_page_template('tem/archives.php') ){echo 'jQuery(document).ready(function(){p="展开",q="折叠";$("#car-toggle").click(function(){p==$(this).text()?($(".car-list ul").slideDown(500),$(this).text(q)):($(".car-list ul").slideUp(500),$(this).text(p))});});';
}?>
<?php
	}
}
?>
</script>
<?php wp_footer()?>
</body>
</html>